package oneday.one;
import org.junit.Test;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
/**
 * Created by ZPF on 2019/10/25.
 */
public class HelloWorld extends HttpServlet{
    private String message;

    @Override
    public void init() throws ServletException{
        message ="Hello, function init() start!";
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,IOException{
        resp.setContentType("text/html");
        PrintWriter out =resp.getWriter();
        out.println("<h3>" + "message：" + message + "</h3>");
    }
    @Test
    public void func1(){
        System.out.println("helloworld1!");
    }
    @Test
    public void func2(){
        System.out.println("helloworld2!");
    }
}
